// * 前面增加 user/ 为了解决同名的时候也会修改数据, 所做的区分
const UserReducer = (
  state = {
    name: 'daj',
    age: 24,
  },
  action
) => {
  if (action.type === 'user/setDajName') {
    return {
      ...state,
      name: action.payload,
    }
  }

  if (action.type === 'user/setDajAge') {
    return {
      ...state,
      age: action.payload,
    }
  }
  return state
}

export default UserReducer
